package cn.shyouchi.wuguanjia.android.api.patrol;

import java.util.List;
import java.util.Map;

import cn.shyouchi.wuguanjia.android.model.BaseRequestResult;
import cn.shyouchi.wuguanjia.android.ui.event.checknum.CheckNumLineEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.PatrolRateEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.begin.PatrolManagerEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.begin.PatrolRingDesEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.report.PatrolErrorEntity;
import cn.shyouchi.wuguanjia.android.ui.patrol.statistic.PatrolStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.statistic.SignStatisticManagerEntity;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by Eenie on 2017/1/3 at 9:40
 * Email: 472279981@qq.com
 * Des:巡检API
 */

public interface PatrolService {


    /**
     * 获取巡检线路
     *
     * @param token
     * @return
     */
    @GET("inspection/lineList")
    Observable<CheckNumLineEntity> getPatrolLines(@Header("token") String token);

    @GET("inspectionList")
    Observable<PatrolRingDesEntity> getPatrolLinePoints(@Header("token") String token, @Query("lineid") String lineid);

    @GET("inspectionRate")
    Observable<PatrolRateEntity> getPatrolRate(@Header("token") String token, @Query("lineid") String lineid);

    @GET("management/userList")
    Observable<PatrolManagerEntity> getManagers(@Header("token") String token);

    @GET("warrantyList")
    Observable<PatrolErrorEntity> getWarrantyList(@Header("token") String token, @Query("type") String type);
    @GET("inspection/statistics")
    Observable<PatrolStatisticEntity> getStatisticsList(@Header("token") String token, @QueryMap Map<String,Object> params);

    @Multipart
    @POST("inspectionAdd")
    Observable<BaseRequestResult> submitPatrol(@Header("token") String token, @PartMap Map<String, RequestBody> data, @Part List<MultipartBody.Part> imgs);



    @GET("total/index")
    Observable<SignStatisticManagerEntity> getEvents(@Header("token") String token);


    /**
     * 月份统计
     * @param token
     * @param projectid
     * @param date
     * @return
     */
    @GET("inspection/total")
    Observable<PatrolStatisticEntity> getMonthStatistic(@Header("token") String token, @Query("projectid") String projectid, @Query("date") String date);


}
